<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <script src="../js/mui.min.js"></script>
    <link href="../css/mui.min.css" rel="stylesheet"/>
    <script src="../js/public.js"></script>
    <script src="../js/jquery.js"></script>
    <style>
    	/* 消息区域   */
    	.mission{width: 98%; margin:2rem 1%;}
    	.mui-table-view{background: transparent;}
    	.mui-table-view .mui-table-view-cell{background-color: #FFF; border:0; width: 100%; height: 5rem; margin-bottom: 1rem; z-index: 9998;}
    	.mui-table-view .mui-table-view-cell a{padding: 0; z-index: 10000;}
    	.mui-table-view .mui-table-view-cell a div{height: 5rem;}
    	.mui-table-view .mui-table-view-cell a div p{height: 1.6rem; line-height: 1.6rem; font-size: 1rem;}
    	.mui-table-view .mui-pull-left{width: 9%; height: 4rem; margin: 0.5rem 2%;}
    	.mui-table-view .mui-pull-right{float: right; width:25%; text-align: center;}
    	.mui-table-view .mui-pull-right span{position: absolute; bottom: 0.5rem; right: 0.5rem; font-size: 0.8rem; color:#929292;}
    	.mui-table-view .mui-media-body{width: 62%; float: left;}
    	.cz{font-style: normal;}
    </style>
</head>
<body>	
	<div id="pullrefresh" class="mui-content">
	    <div class="mui-content-padded mission">
			<ul class="mui-table-view dai">
			    
			</ul>
	    </div>
	</div>
</body>
 <script type="text/javascript" charset="utf-8">
      	mui.init({
      		swipeBack: false,
			pullRefresh: {
				container: '#pullrefresh',
				down: {
					auto: false,
				    contentdown : "下拉可以刷新",
			    	contentover : "释放立即刷新",
			    	contentrefresh : "正在刷新...",
					callback: xjx
				}
			},
      		tap: true, //默认为true
		   	doubletap: true, //默认为false
		   	longtap: true, //默认为false
		   	swipe: true, //默认为true
		  	drag: true, //默认为true
		  	hold:false,//默认为false，不监听
		  	release:false//默认为false，不监听
      	});
      	
      	function xjx(){
      		location.reload();
      	};
		//
      	var user = JSON.parse(localStorage.getItem('$users')).account;
	  	function send(){
	     	mui.ajax({
	            type: "post",
			    url: __PATH__+"index/work_2",
			    async: true,
			    data:{
			    	user:user
			    },
			    dataType: "json",
			    json: "jsoncallback",
			    timeout: 1000,
			    success: function(data) {
			    	console.log(data);
			    	$.each(data,function(i,item){
						var s='<li class="mui-table-view-cell"><a href="javascript:void(0);" class="cs"><input type="hidden" class="createtime" value="'+item.createtime+'" /><input type="hidden" class="id" value="'+item.id+'" /><input type="hidden" class="resourceLocation" value="'+item.resourceLocation+'" /><input type="hidden" class="orderNo" value="'+item.orderNo+'" /><input type="hidden" class="resourcePicture" value="'+item.resourcePicture+'" /><input type="hidden" class="updatetime" value="'+item.updatetime+'" /><input type="hidden" class="resourceName" value="'+item.resourceName+'" /><input type="hidden" class="abnormal_name" value="'+item.abnormal_name+'" /> <img class="mui-pull-left imgs" src="'+item.resourcePicture+'"><div class="mui-media-body"><p><span>编号：</span><span class="order_num">'+item.orderNo+'</span></p><p><span>名称：</span><span class="order_name">'+item.resourceName+item.abnormal_name+'</span></p><p><span>地址：</span><span class="order_area">'+item.resourceLocation+'</span></p></div><div class="mui-pull-right"><span class="order_time">'+item.updatetime+'</span></div></a></li>';	
						$(".dai").append(s);                     
					});
			    },
			    error:function(xhr,type,errorThrown){
					mui.alert("加载失败！请重刷页面",'提示') 				
				}
			});
	     };
	     setTimeout("send()",500);
      	//
      	mui(".dai").on('tap',".cs",function(){
      		var resourceName = $(this).find(".resourceName").val();
      		var orderNo = $(this).find(".orderNo").val();
      		var abnormal_name = $(this).find(".abnormal_name").val();
      		var resourceLocation = $(this).find(".resourceLocation").val();
      		var updatetime = $(this).find(".updatetime").val();
      		var resourcePicture = $(this).find(".resourcePicture").val();
      		var order_id = $(this).find(".id").val();
      		var createtime = $(this).find(".createtime").val();
      		mui.openWindow({
			    id:'work',
			    url:'work.html',
			    extras:{
			        resourceName:resourceName,
			        resourceNo:orderNo,
			        resourceLocation:resourceLocation,
			        updatetime:updatetime,
			        order_id:order_id,
			        resourcePicture:resourcePicture,
			        abnormal_name:abnormal_name,
			        createtime:createtime
			    },
			    show: {
					aniShow: 'pop-in'
				},
				styles: {
					popGesture: 'hide'
				},
				waiting: {
					autoShow: false
				}
			});
      	});
    </script>
</html>